<%@page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="edu.rutgers.rucampusinfo.tables.Employee" %>
<%@ page import="java.util.List" %>
<%@ page import="edu.rutgers.rucampusinfo.tables.Role" %>
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
		<link type="text/css" rel="stylesheet" href="css/style_empdir.css" />
		<link type="text/css" rel="stylesheet" href="css/empdir.css" />
		<link type="text/css" rel="stylesheet" href="css/tabber.css" />
		<script type="text/javascript" src="js/empdir.js"></script>
		<script type="text/javascript" src="js/tabber.js"></script>
		<script type="text/javascript" src="js/tabber-minimized.js"></script>
		<link rel="SHORTCUT ICON" href="images/favicon.ico" />
		<%
			List<Employee> emplist = (List<Employee>)request.getAttribute("employeelist"); 
			String sort = (String)request.getAttribute("sort"); 
				int size = Integer.parseInt((String)request.getAttribute("size"));
				int split = size/3;
				int indexa = 0;
		%>
	</head>
	<body>
	<div class="container" id="container">
	<div class="tabber" id="maintab">
	<div class="tabbertab">
		<h2>Active Employees</h2>  
			<div class="contentBoxCenter">
	        	<!--Employee List-->
      			<div class="contentBoxHeader">
				<span>Total Active Employees</span><label id="EmployeeCount" ><%=size %></label>
			</div>
       		<div class="contentBoxMain" overflow: auto;">
				<a href="/employeedirectory?sort=first">Sort by First Name</a><br />
				<a href="/employeedirectory?sort=last">Sort by Last Name</a>
							
		       	<table id="table1">
				<tr>
				<td colspan="3">
				&nbsp;
				</td>
				</tr>
	          		  <tr>   			  	
	          		  	<td>
	          			  	<%
	          			  	int k = 0;
	          			  for(int j = indexa; j <emplist.size(); j++){
	          				  
	          				  if ((j % split) == 0){
	          					  %>
	          					  </td>
	          					  <td>
	          					  <%
	          					  if(k==0){
	          						  %>
	          						  <br />
	          						  <%
	          						  k = 1;
	          					  }
	          				  }
	          				  String lnamea = emplist.get(j).getLname();
	          					String lnameb = "0";
	          					if(j!=0){lnameb = emplist.get(j-1).getLname();}
	          				  if (lnamea.substring(0,1).equals(lnameb.substring(0,1))){
	          						if(sort.equalsIgnoreCase("last")){
	          							%>
	    	    
	    	                    		<a href="javascript:showEmployeeDetails('<%=emplist.get(j).getNetid() %>');"><label id="EmployeeList" ><%=emplist.get(j).getLname() %>, <%=emplist.get(j).getFname() %></label></a><br />
	    	                     		<%
	          						}else{
	          							%>
	          							
	    	                    		<a href="javascript:showEmployeeDetails('<%=emplist.get(j).getNetid() %>');"><label id="EmployeeList" ><%=emplist.get(j).getFname() %> <%=emplist.get(j).getLname() %></label></a><br />
	    	                     		<%
	          						}
	          				  }else{
	          					if (j > 0){
	          						%>
	          					<br />
	          					<% 
	          					}
	          					if(sort.equalsIgnoreCase("last")){
	          							%>
	    	                    		<a href="javascript:showEmployeeDetails('<%=emplist.get(j).getNetid() %>');"><label id="EmployeeList" ><%=emplist.get(j).getLname() %>, <%=emplist.get(j).getFname() %></label></a><br />
	    	                     		<%
	          						}else{
	          							%>
	    	                    		<a href="javascript:showEmployeeDetails('<%=emplist.get(j).getNetid() %>');"><label id="EmployeeList" ><%=emplist.get(j).getFname() %> <%=emplist.get(j).getLname() %></label></a><br />
	    	                     		<%
	          						}
	          			  }
	          			  }
	                     	%>
	                	</td>
	           		 </tr>
	        	</table>
        <!--End employee list -->
		</div>
	</div>
</div>
<div class="tabbertab">
	<h2>Roles</h2>

	<div class="contentBoxCenter">	
		   <!--Group List-->
			<div class="contentBoxHeader">
				<span>Roles</span><label id="LangCount" ></label>
			</div>
			
			<div class="contentBoxMain">
				<table>
		            <tr>
		                <td>
		                    <label id="GroupedbyLangEmployeeList" ></label>
		                </td>
		            </tr>
		        </table>
			</div>
	        <!--Group List-->
		</div>


</div>
	
	
	<div class="tabbertab">
	<h2>Languages</h2>
	

		<div class="contentBoxCenter">	
		   <!--Group List-->
			<div class="contentBoxHeader">
				<span>Languages</span><label id="LangCount" ></label>
			</div>
			
			<div class="contentBoxMain">
				<table>
		            <tr>
		                <td>
		                    <label id="GroupedbyLangEmployeeList" ></label>
		                </td>
		            </tr>
		        </table>
			</div>
	        <!--Group List-->
		</div>
	  
    </div>
    
        <!--Graduation Tab Harsh Yadav!-->
    <div class="tabbertab">
	<h2>Graduation</h2>
	

		<div class="contentBoxCenter">	
		   <!--Group List-->
			<div class="contentBoxHeader">
				<span>Total Graduates</span><label id="GradCount" ></label></div>
			
			<div class="contentBoxMain">
		

			
			 </div>
	        <!--Group List-->
	</div>
	  
    </div>
<!--Graduation Tab Ends !-->


    <div class="tabbertab">
	<h2>Former Employees</h2>
	
		<div class="contentBoxCenter">
			<!--Former Employee List-->
			<div class="contentBoxHeader">
				<span>Total Former Employees</span><asp:Label ID="InactiveEmployeeCount" runat=server></asp:Label>
			</div>
	        
			<div class="contentBoxMain">
				<a href="?sort=first">Sort by First Name</a><br />
				<a href="?sort=last">Sort by Last Name</a><br />
				<table>
		            <tr>
		                <td>
		                    
		                </td>
		            </tr>
		        </table>
			</div>
	        <!--End Former Employee List -->
		</div>
	  
	 
    </div>     
                  
          

     
	 </div>
		</div>
	</body>
</html>